package io.xiyou.order.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.xiyou.order.dao.model.Order;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface OrderMapper extends BaseMapper<Order> {

    /**
     * 批量插入
     *
     * @param list
     * @return
     */
    int batchInsert(List<Order> list);

    /**
     * 根据用户ID查询订单列表
     *
     * @param userId
     * @return
     */
    List<Order> getByUserId(Long userId);

    /**
     * 支付成功
     *
     * @param order
     * @return
     */
    int paySuccess(Order order);

}